public class Leetcode944 {
    public int minDeletionSize(String[] strs) {
        int m = strs[0].length();

        int count = 0;

        for (int i = 0; i < m; ++i) {
            char c = strs[0].charAt(i);
            for (int j = 1; j < strs.length; ++j) {
                char d = strs[j].charAt(i);
                if (c > d) {
                    ++count;
                    break;
                }

                c = d;
            }
        }

        return count;
    }
}
